﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace ZK.MyControl
{
   public class TrackBarPanel: Panel
    {

        private Label label1 = new Label();
        TrackBar trackBar1 = new TrackBar();
        public TrackBarPanel()
        {
            label1.AutoSize = false;
            label1.Dock = DockStyle.Left;
            this.Controls.Add(label1);
            trackBar1.AutoSize = false;
            trackBar1.Dock = DockStyle.Fill;
            this.Controls.Add(trackBar1);

            trackBar1.ValueChanged += TrackBar1_ValueChanged;
        }

        private void TrackBar1_ValueChanged(object sender, EventArgs e)
        {
            Label.Text = trackBar1.Value.ToString();
        }

        public Label Label {

            get {
                return label1;
            }
            set {
                label1 = value;
            }
        }

        public TrackBar TrackBar
        {

            get
            {
                return trackBar1;
            }
            set
            {
              
               trackBar1 = value;
               
            }
        }
    }
}
